﻿@{
    <link href="~/css/table.css" rel="stylesheet" />
    <script src="~/js/jquery-1.11.1.js"></script>
    <script src="~/js/vue.js"></script>
}

<body>
    <div id="app">
        <form role="form" id="form1">
            <table width="100%">
                <tr>
                    <td>
                        <font color="black">您正在做的业务是:人力资源--调动管理--调动审核</font>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <input type="radio" id="check_status" name="check_status" v-model="check_status" value="true">通过
                        <input type="radio" name="check_status" id="check_status" v-model="check_status" value="false">不通过
                        <input type="button" value="确认" class="BUTTON_STYLE1" v-on:click="check()">
                        <input type="button" class="BUTTON_STYLE1" onclick="javascript:window.history.back();" value="返回">
                    </td>
                </tr>
            </table>
            <table width="100%" border="1" cellpadding=0 cellspacing=1
                   bordercolorlight=#848284 bordercolordark=#eeeeee
                   class="TABLE_STYLE1">
                <tr height="21">
                    <td class="TD_STYLE1" width="8%" hidden>主键</td>
                    <td class="TD_STYLE2" width="10%" hidden>
                        <input type="text" v-model="mch_id" readonly="readonly"
                               class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1" width="8%" hidden>人力主键</td>
                    <td class="TD_STYLE2" width="10%" hidden>
                        <input type="text" v-model="huf_id" readonly="readonly"
                               class="INPUT_STYLE2">
                    </td>

                    <td class="TD_STYLE1" width="8%">
                        档案编号
                    </td>
                    <td class="TD_STYLE2" width="10%">
                        <input type="text" id="human_id" name="human_id" v-model="human_id" readonly="readonly"
                               class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                        姓名
                    </td>
                    <td class="TD_STYLE2" width="10%">
                        <input type="text" v-model="human_name"
                               readonly="readonly"
                               class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                    </td>
                    <td class="TD_STYLE2" width="10%">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                    </td>
                    <td class="TD_STYLE2" width="10%">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1" width="8%">
                        原一级机构
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" @*id="first_kind_name" name="first_kind_name"*@
                               v-model="first_kind_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" @*id="first_kind_id" name="first_kind_id"*@ v-model="first_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                        原二级机构
                    </td>
                    <td class="TD_STYLE2" width="10%">
                        <input type="text" @*id="second_kind_name" name="second_kind_name"*@
                               v-model="second_kind_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" @*id="second_kind_id" name="second_kind_id"*@ v-model="second_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                        原三级机构
                    </td>
                    <td class="TD_STYLE2" width="10%">
                        <input type="text" @*id="third_kind_name" name="third_kind_name"*@
                               v-model="third_kind_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" @*name="third_kind_id" id="third_kind_id"*@ v-model="third_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                    </td>
                    <td class="TD_STYLE2" width="10%">
                    </td>
                </tr>

                <tr>
                    <td class="TD_STYLE1">
                        原职位分类
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" @*id="major_kind_name" name="major_kind_name"*@
                               v-model="major_kind_name" readonly="readonly"
                               value="" class="INPUT_STYLE2">
                        <input type="hidden" @*id="major_kind_id" name="major_kind_id"*@ v-model="major_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="12%">
                        原职位名称
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" @*id="major_name" name="major_name"*@
                               v-model="major_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" @*id="major_id" name="major_id"*@ v-model="major_id">
                    </td>
                    <td class="TD_STYLE1">
                        原薪酬标准
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" @*id="salary_standard_name" name="salary_standard_name"*@
                               v-model="salary_standard_name"
                               readonly="readonly" class="INPUT_STYLE2">
                        <input type="hidden" @*id="salary_standard_id" name="salary_standard_id"*@ v-model="salary_standard_id">
                    </td>
                    <td class="TD_STYLE1">
                        原薪酬总额
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" @*id="salary_sum" name="salary_sum"*@ v-model="salary_sum"
                               readonly="readonly"
                               class="INPUT_STYLE2">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        新一级机构名称
                    </td>
                    <td class="TD_STYLE2">                      
                        <input type="text" id="first_kind_name" name="first_kind_name"
                               v-model="new_first_kind_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" id="first_kind_id" name="first_kind_id" v-model="new_first_kind_id">
                    <td class="TD_STYLE1" width="12%">
                        新二级机构名称
                    </td>
                    <td class="TD_STYLE2">                    
                        <input type="text" id="second_kind_name" name="second_kind_name"
                               v-model="new_second_kind_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" id="second_kind_id" name="second_kind_id" v-model="new_second_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="12%">
                        新三级机构名称
                    </td>
                    <td class="TD_STYLE2">
                       
                        <input type="text" id="third_kind_name" name="third_kind_name"
                               v-model="new_third_kind_name" readonly="readonly"
                               class="INPUT_STYLE2">
                        <input type="hidden" name="third_kind_id" id="third_kind_id" v-model="new_third_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="8%">
                    </td>
                    <td class="TD_STYLE2" width="10%">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        新职位分类
                    </td>
                    <td class="TD_STYLE2">                        
                        <input type="text" id="human_major_kind_name" name="human_major_kind_name"
                               v-model="new_major_kind_name" readonly="readonly"
                               value="" class="INPUT_STYLE2">
                        <input type="hidden" id="human_major_kind_id" name="human_major_kind_id" v-model="new_major_kind_id">
                    </td>
                    <td class="TD_STYLE1" width="12%">
                        新职位名称
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" id="hunma_major_name" name="hunma_major_name"
                               v-model="new_major_name" readonly="readonly"
                               value="" class="INPUT_STYLE2">
                        <input type="hidden" id="human_major_id" name="human_major_id" v-model="new_major_id">
                    </td>
                    <td class="TD_STYLE1">
                        新薪酬标准
                    </td>
                    <td class="TD_STYLE2">                        
                        <input type="text" id="salary_standard_name" name="salary_standard_name"
                               v-model="new_salary_standard_name" readonly="readonly"
                               value="" class="INPUT_STYLE2">
                        <input type="hidden" id="salary_standard_id" name="salary_standard_id" v-model="new_salary_standard_id">
                    </td>
                    <td class="TD_STYLE1">
                        新薪酬总额
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="salary_sum" id="salary_sum" v-model="new_salary_sum" readonly="readonly"
                               value="0.00" class="INPUT_STYLE2">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        登记人
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="register" id="register" readonly="readonly" value="better_admin"
                               class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        登记时间
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="regist_time" readonly="readonly"
                               id="regist_time" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        复核人
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="checker" id="checker" readonly="readonly" value="better_admin" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        复核时间
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="check_time" id="Tdate" class="INPUT_STYLE2">
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        调动原因
                    </td>
                    <td colspan="7" class="TD_STYLE2">
                        <textarea name="change_reason" id="change_reason" v-model="change_reason" rows="6" readonly="readonly" class="TEXTAREA_STYLE1">
						
						</textarea>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        复合通过意见
                    </td>
                    <td colspan="7" class="TD_STYLE2">
                        <textarea name="check_reason" id="check_reason" v-model="check_reason" rows="6" class="TEXTAREA_STYLE1"></textarea>
                    </td>
                </tr>
            </table>
        </form>
    </div>
</body>
<script type="text/javascript">
    function time() {
        var tdate = document.getElementById("Tdate");
        var d = new Date();
        var y = d.getFullYear();
        var moth = d.getMonth() + 1;
        var date = d.getDate();
        var h = d.getHours();
        var m = d.getMinutes();
        var s = d.getSeconds();
        var hh = 20 - 1 - h;
        var mm = 60 - 1 - m;
        var ss = 60 - s;
        if (hh > 0) {
            mm = mm + 60 * hh;
        }
        if (moth < 10) {
            moth = "0" + moth;
        }
        if (date < 10) {
            date = "0" + date;
        }
        if (h < 10) {
            h = "0" + h;
        }
        if (m < 10) {
            m = "0" + m;
        }
        if (s < 10) {
            s = "0" + s;
        }
        if (mm < 10) {
            mm = "0" + mm;
        }
        if (ss < 10) {
            ss = "0" + ss;
        }
        tdate.value = y + "-" + moth + "-" + date + " " + h + ":" + m + ":" + s;
    }
    window.onload = time;
    var out = window.setInterval(time, 1000);

    var vm = new Vue({
        el: "#app",
        data: {
            sj: [],
            mch_id: "",
            huf_id:"",
            first_kind_id:"",
            first_kind_name :"",
            second_kind_id :"",
            second_kind_name :"",
            third_kind_id :"",
            third_kind_name :"",
            major_kind_id :"",
            major_kind_name :"",
            major_id  :"",
            major_name :"",
            new_first_kind_id :"",
            new_first_kind_name :"",
            new_second_kind_id :"",
            new_second_kind_name :"",
            new_third_kind_id :"",
            new_third_kind_name :"",
            new_major_kind_id :"",
            new_major_kind_name :"",
            new_major_id :"",
            new_major_name :"",
            human_id :"",
            human_name :"",
            salary_standard_id :"",
            salary_standard_name :"",
            salary_sum :"" ,
            new_salary_standard_id :"",
            new_salary_standard_name :"",
            new_salary_sum :"",
            change_reason :"",
            check_reason :"",
            check_status :"",
            register :"",
          //  checker :"",
            regist_time :"" ,
           // check_time :"" 
        },
        methods: {
            load: function () {

                var t = this;
             //   alert(@ViewData["id"]);
                $.ajax({
                    url: "/diaodongguanli/check1?id="+@ViewData["id"],
                    type: "post",
                      success: function (msg) {
                          var dt = eval("(" + msg + ")");
                          t.mch_id = dt.mch_id;
                          t.huf_id = dt.huf_id;
                          t.first_kind_id = dt.first_kind_id;
                          t.first_kind_name = dt.first_kind_name;
                          t.second_kind_id = dt.second_kind_id;
                          t.second_kind_name = dt.second_kind_name;
                          t.third_kind_id = dt.third_kind_id;
                          t.third_kind_name = dt.third_kind_name;
                          t.major_kind_id = dt.major_kind_id;
                          t.major_kind_name = dt.major_kind_name;
                          t.major_id = dt.major_id;
                          t.major_name = dt.major_name;
                          t.new_first_kind_id = dt.new_first_kind_id;
                          t.new_first_kind_name = dt.new_first_kind_name;
                          t.new_second_kind_id = dt.new_second_kind_id;
                          t.new_second_kind_name = dt.new_second_kind_name;
                          t.new_third_kind_id = dt.new_third_kind_id;
                          t.new_third_kind_name = dt.new_third_kind_name;
                          t.new_major_kind_id = dt.new_major_kind_id;
                          t.new_major_kind_name = dt.major_kind_name;
                          t.new_major_id = dt.new_major_id;
                          t.new_major_name = dt.new_major_name;
                          t.human_id = dt.human_id;
                          t.human_name = dt.human_name;
                          t.salary_standard_id = dt.salary_standard_id
                          t.salary_standard_name = dt.salary_standard_name;
                          t.salary_sum = dt.salary_sum;
                          t.new_salary_standard_id = dt.new_salary_standard_id;
                          t.new_salary_standard_name = dt.new_salary_standard_name;
                          t.new_salary_sum = dt.new_salary_sum;
                          t.change_reason = dt.change_reason
                          t.check_reason = dt.check_reason;
                          t.check_status = dt.check_status;
                          t.register = dt.register;
                     //     t.checker = dt.checker;
                          t.regist_time = dt.register;
                       //   t.check_time = dt.check_time;

                          var time = new Date(dt.regist_time);
                          var y = time.getFullYear();
                          var m = time.getMonth();
                          var d = time.getDate();     
                          var h = time.getHours();
                          var f = time.getMinutes();
                          var s = time.getSeconds();
                          $("#regist_time").val(y + "-" + m + "-" + d + " "+h+":"+f+":"+s)
                    }
                });

            },
            check: function () {
                var rs = document.getElementsByName("check_status");
                if (rs[0].checked == false && rs[1].checked == false) {
                    alert("请选择通过或者不通过！!");
                    return false();
                }
                else {
                var radio = $("input[type='radio']:checked").val();
                    if (radio == "false") {
                        alert('很抱歉,本次调动不通过');
                        location.href = "/diaodongguanli/check_list";
                    } else {
                        $.ajax({
                            url: "/diaodongguanli/check",
                            type: "post",
                            data: $("#form1").serialize(),
                            success: function (msg) {
                                if (msg > 0) {
                                    alert("调动通过！")
                                    location.href = "/diaodongguanli/check_success";
                                }
                            }
                        });
                    }
                }                         
            }
        },
        mounted: function () {
            this.load();           

        }
        
    })
</script>





